Knuth–Morris–Pratt algorithm
STRING SEARCHING ALGORITHM
Knuth Morris Pratt algorithm; Knuth-Morris-Pratt Algorithm; Knuth-morris-pratt algorithm; Knuth morris pratt algorithm; Knuth-Pratt-Morris algorithm; Knuth-morris-pratt; Knuth-Morris-Pratt algorithm; KMP algorithm; Knuth-Morris-Pratt string matching algorithm; Nuth-Morris-Pratt string matching algorithm; Knuth-Pratt-Morris; Knuth-Morris-Pratt; Knuth-pratt-morris algorithm; KMP search; Kmp search; Failure function; Knuth Morris Pratt; Knuth–Morris–Pratt
In computer science, the Knuth–Morris–Pratt string-searching algorithm (or KMP algorithm) searches for occurrences of a "word" W within a main "text string" S by employing the observation that when a mismatch occurs, the word itself embodies sufficient information to determine where the next match could begin, thus bypassing re-examination of previously matched characters.